package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the PURCHASETICKET database table.
 * 
 */
@Entity
@NamedQuery(name="Purchaseticket.findAll", query="SELECT p FROM Purchaseticket p")
public class Purchaseticket implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="PURCHASETICKET_PTID_GENERATOR", sequenceName="SEQ_38")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="PURCHASETICKET_PTID_GENERATOR")
	@Column(name="PT_ID")
	private long ptId;

	@Column(name="PT_ABSTRACT")
	private String ptAbstract;

	@Column(name="PT_CAI_ID")
	private BigDecimal ptCaiId;

	@Column(name="PT_CAI_NAME")
	private String ptCaiName;

	@Column(name="PT_CUS_ID")
	private BigDecimal ptCusId;

	@Column(name="PT_CUS_NAME")
	private String ptCusName;

	@Column(name="PT_IF_PAY")
	private String ptIfPay;

	@Column(name="PT_MONEY")
	private BigDecimal ptMoney;

	@Column(name="PT_PERIOD")
	private BigDecimal ptPeriod;

	@Column(name="PT_REMARKS")
	private String ptRemarks;

	@Temporal(TemporalType.DATE)
	@Column(name="PT_TIME")
	private Date ptTime;

	@Column(name="PT_TYPE")
	private String ptType;

	//bi-directional many-to-one association to PurchaseTb
	@ManyToOne
	@JoinColumn(name="PURCHASE_ID")
	private PurchaseTb purchaseTb;

	//bi-directional many-to-one association to PurchaseTb
	@OneToMany(mappedBy="purchaseticket")
	private List<PurchaseTb> purchaseTbs;

	public Purchaseticket() {
	}

	public long getPtId() {
		return this.ptId;
	}

	public void setPtId(long ptId) {
		this.ptId = ptId;
	}

	public String getPtAbstract() {
		return this.ptAbstract;
	}

	public void setPtAbstract(String ptAbstract) {
		this.ptAbstract = ptAbstract;
	}

	public BigDecimal getPtCaiId() {
		return this.ptCaiId;
	}

	public void setPtCaiId(BigDecimal ptCaiId) {
		this.ptCaiId = ptCaiId;
	}

	public String getPtCaiName() {
		return this.ptCaiName;
	}

	public void setPtCaiName(String ptCaiName) {
		this.ptCaiName = ptCaiName;
	}

	public BigDecimal getPtCusId() {
		return this.ptCusId;
	}

	public void setPtCusId(BigDecimal ptCusId) {
		this.ptCusId = ptCusId;
	}

	public String getPtCusName() {
		return this.ptCusName;
	}

	public void setPtCusName(String ptCusName) {
		this.ptCusName = ptCusName;
	}

	public String getPtIfPay() {
		return this.ptIfPay;
	}

	public void setPtIfPay(String ptIfPay) {
		this.ptIfPay = ptIfPay;
	}

	public BigDecimal getPtMoney() {
		return this.ptMoney;
	}

	public void setPtMoney(BigDecimal ptMoney) {
		this.ptMoney = ptMoney;
	}

	public BigDecimal getPtPeriod() {
		return this.ptPeriod;
	}

	public void setPtPeriod(BigDecimal ptPeriod) {
		this.ptPeriod = ptPeriod;
	}

	public String getPtRemarks() {
		return this.ptRemarks;
	}

	public void setPtRemarks(String ptRemarks) {
		this.ptRemarks = ptRemarks;
	}

	public Date getPtTime() {
		return this.ptTime;
	}

	public void setPtTime(Date ptTime) {
		this.ptTime = ptTime;
	}

	public String getPtType() {
		return this.ptType;
	}

	public void setPtType(String ptType) {
		this.ptType = ptType;
	}

	public PurchaseTb getPurchaseTb() {
		return this.purchaseTb;
	}

	public void setPurchaseTb(PurchaseTb purchaseTb) {
		this.purchaseTb = purchaseTb;
	}

	public List<PurchaseTb> getPurchaseTbs() {
		return this.purchaseTbs;
	}

	public void setPurchaseTbs(List<PurchaseTb> purchaseTbs) {
		this.purchaseTbs = purchaseTbs;
	}

	public PurchaseTb addPurchaseTb(PurchaseTb purchaseTb) {
		getPurchaseTbs().add(purchaseTb);
		purchaseTb.setPurchaseticket(this);

		return purchaseTb;
	}

	public PurchaseTb removePurchaseTb(PurchaseTb purchaseTb) {
		getPurchaseTbs().remove(purchaseTb);
		purchaseTb.setPurchaseticket(null);

		return purchaseTb;
	}

}